<?php
if(!isset($GLOBALS['_vars'])) $GLOBALS['_vars'] = array(); 
$fields = array();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>收藏夹 - <?php echo $cfg_webname; ?></title>
<link href="templets/style/css/reset.css" rel="stylesheet" type="text/css">
<link href="templets/style/css/member.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="templets/js/j.js"></script>
<script type="text/javascript">
function go_jump2(url,page,max){
	var g = /^[1-9]*[1-9][0-9]*$/;
	if(!g.test(page)){
		alert("页码格式不正确！");
		return;
	}else if(page > max){
		alert("此页码不存在！");
		return;
	}
	window.location.href=url;
}


<!--
if(moz == null) 
{
	var ie = document.all != null;
	var moz = !ie && document.getElementById != null && document.layers == null;
}
if(moz) {
	extendEventObject();
	extendElementModel();
	emulateAttachEvent();
}

function delArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	if(window.confirm("是否从收藏夹中移除这些文档？"))
	{
		location="archives_do.php?id="+qstr+"&dopost=delStowdx";
	}
}

//获得选中文件的文件名
function getCheckboxItem()
{
	var allSel="";
	if(document.form2.aid.value) return document.form2.aid.value;
	for(i=0;i<document.form2.aid.length;i++)
	{
		if(document.form2.aid[i].checked)
		{
			if(allSel=="")
				allSel=document.form2.aid[i].value;
			else
				allSel=allSel+"`"+document.form2.aid[i].value;
		}
	}
	return allSel;
}

//获得选中其中一个的id
function getOneItem()
{
	var allSel="";
	if(document.form2.aid.value) return document.form2.aid.value;
	for(i=0;i<document.form2.aid.length;i++)
	{
		if(document.form2.aid[i].checked)
		{
				allSel = document.form2.aid[i].value;
				break;
		}
	}
	return allSel;
}

function selAll()
{
	for(i=0;i<document.form2.aid.length;i++)
	{
		if(!document.form2.aid[i].checked)
		{
			document.form2.aid[i].checked=true;
		}
	}
}
function noSelAll()
{
	for(i=0;i<document.form2.aid.length;i++)
	{
		if(document.form2.aid[i].checked)
		{
			document.form2.aid[i].checked=false;
		}
	}
}
-->

</script>
</head>
<body>

<!--head-->
<?php include(DEDEMEMBER. "/templets/head.htm"); ?>

<div class="main">

<?php include(DEDEMEMBER."/templets/menu.php"); ?> 

<div class="main_right">

<div class="common-titbox">
<div class="common_title left" style="margin-bottom:0px;">我的收藏</div>
<div class="common_scj right">收藏内夹共有 <i><?php echo $mystowdata_num;?></i> 个素材，共计 <i><?php echo $mystowdata_money;?></i> 金币</div>
<div class="scj-cz"><a href="buy.php" target="_blank">充值金币</a></div>
</div>
<form name="form2">
<input type="hidden" name="dopost" value="delStow" />
<ul class="wdsc_list">
<?php
$atts = array();
$atts['tagname'] = 'datalist';
$blockValue = $this->refObj->GetArcList($atts,$this->refObj,$fields); 
if(is_array($blockValue)){
foreach( $blockValue as $key=>$fields )
{
?>
<li>
<div class="dow"><a href="<?php echo $cfg_phpurl; ?>/view.php?aid=<?php echo $fields['id']; ?>" target="_blank">下载</a></div>
<a href="archives_do.php?dopost=delStow&aid=<?php echo $fields['aid']; ?>" class="del" onclick="javascript:return confirm('确认将<?php echo $fields['title']; ?>移除收藏夹吗？');">移除</a>
<a href="<?php echo $cfg_phpurl; ?>/view.php?aid=<?php echo $fields['id']; ?>" target="_blank"><img src="<?php if($fields['litpic']=='') echo $fields['litpic']=$cfg_cmsurl.'/images/defaultpic.gif'; else echo $fields['litpic']; ?>"></a>
<h5><?php
            if($fields['arcrank']>=0) echo "<span class='ytg-y'>已通过</span>";
            else if($fields['arcrank']==-2) echo "<span class='ytg-r'>待修改</span>";
            else if($fields['arcrank']==-3) echo "<span class='ytg-r'>未通过</span>";
            else if($fields['arcrank']==-4) echo "<span class='ytg-r'>被投诉</span>";
            else echo "<span class='ytg-h'>审核中</span>";
            ?><a href="<?php echo $cfg_phpurl; ?>/view.php?aid=<?php echo $fields['id']; ?>" target="_blank"><?php echo $fields['title']; ?></a> <!--i>素材收益率<?php
         $scys = sprintf("%01.2f", $cfg_scsy*100);
		 $scys = floatval($scys).'%'; 
         echo $scys;
         ?></i--></h5>
		 <input name="aid" type="checkbox" id="aid" value="<?php echo $fields['aid']; ?>" class="np" />
<div class="scxx">
<p>所需金币：￥<?php echo $fields['needmoney']; ?></p><p>作品编号：M<?php echo $fields['id']; ?></p><p>总收藏量：<?php echo $fields['stows']; ?>次</p>
<p>作品人气：<?php echo $fields['click']; ?>次</p><p>下载次数：<?php echo $fields['dows']; ?>次</p><p>发布时间：<?php echo MyDate('Y-m-d H:i:s',$fields['pubdate']); ?></p>
</div>
</li>
<?php
}
}?>
  <div class="yc">
  <input type="button" class="stows-sub" onclick="selAll()" value="全选" />
  <input type="button" class="stows-sub" onclick="noSelAll()" value="取消" />
  <input type="button" class="stows-sub stows-yc" onclick="delArc(0)" value="移除" />
  </div>
</ul>

<div class="pageList"> <div class="pagelistbox">
<?php
$atts = array();
$atts['tagname'] = 'pagelist';
$atts['listsize'] = '5';
 echo $this->refObj->GetPageList($atts,$this->refObj,$fields); 
?>

</div>
</div>
 </form>
</div>

</div>

<!--footer-->
<?php include(DEDEMEMBER. "/templets/footer.htm"); ?>

<script>
	//会员升级
	var typeid = document.querySelector('#typeid');
	var divs = document.querySelectorAll('.hysj_jiage li div');
	for(var i=0,len=divs.length;i<len;i++){
		divs[i].onclick = divCLickHandler;
	}
	function divCLickHandler(e){
		for(var i=0,len=divs.length;i<len;i++){
			divs[i].className = '';
		}
		this.className = 'cur';
		typeid.value = this.getAttribute('_typeid');
	}
</script>
<script>
	//左边导航
	var as = document.querySelectorAll('.left_menu a');
	var spans = document.querySelectorAll('.left_menu .icons');
	for(var i=0,len=as.length;i<len;i++){
		
		spans[i].clazz = spans[i].className;
		as[i].index = i;
		as[i].onmouseenter = mouseenterHandler;
		as[i].onmouseleave = mouseleaseHandler;
	}
	function mouseenterHandler(e){
		if(!/_h$/.test(spans[this.index].clazz)){
			spans[this.index].className = spans[this.index].clazz + '_h';
		}
	}
	function mouseleaseHandler(e){
		spans[this.index].className = spans[this.index].clazz;
	}
	
	//左右等高布局
	var main_left = document.querySelector('.main_left');
	var main_right = document.querySelector('.main_right');
	if(main_left.offsetHeight<main_right.offsetHeight){
		main_left.style.height = main_right.offsetHeight + 'px';
	}
</script>

</body>
</html>